
"""
import sys
import math

class Match:

    def init(self, w, s, t, k, P, Q):
        self.w = w
        self.s = s
        self.t = t
        self.k = k
        self.P = P
        self.Q = Q

        H_count = (P - w) // s + 1
        V_count = (Q - h) // t + 1
        self.vector = [[] for _ in range(V_count + 1)]

    def input_params(X, Y, W, H):
        i_l, i_r, j_l, j_r =  count(X, Y, W, H, w, h)

        for y_j in range(j_l, j_r + 1):
            if len(vector[y_j]) == 0:
                vector[y_j].append([i_l, i_r])
            elif i_r < vector[y_j][0][0] or i_l > vector[y_j][0][1]:
                vector[y_j].append([i_l, i_r])
            else:
                if i_l <= vector[y_j][0][0]:
                    vector[y_j][0][0] = i_l
                if i_r >= vector[y_j][0][1]:
                    vector[y_j][0][1] = i_r

    def result():
        for n in vector:
            internals = merge(n)
            for n in internals:
                minus = n[1] - n[0] + 1
                total += minus
        return total

    def merge(intervals):
        if intervals == []:
            return []
        intervals.sort(key = lambda x:x[0])
        rel = [intervals[0]]
        for i in intervals[1:]:
            if rel[-1][1] >= i[0]:
                rel[-1][1] = max(rel[-1][1], i[1])
            else:
                rel.append(i)
        return rel

    def count(X, Y, W, H, w, h):
        x_tl = X + 1 - w
        x_tr = X + W - 1 + w
        y_tl = Y + 1 - h
        y_bl = Y + H - 1 + h

        accum = 0
    
        if x_tl > 0:
            x_left_value = x_tl
        else:
            x_left_value = 0
    
        if x_tr > P:
            x_right_value = P
        else:
            x_right_value = x_tr
     
        i_l = int(math.ceil(x_left_value / s))
        i_r = (x_right_value - w) // s
        #i_count = i_r - i_l + 1
    
        if y_tl > 0:
            y_left_value = y_tl
        else:
            y_left_value = 0
    
        if y_bl > Q:
            y_right_value = Q
        else:
            y_right_value = y_bl
        
        j_l = int(math.ceil(y_left_value / t))
        j_r = (y_right_value - h) // t
        #j_count = j_r - j_l + 1

        return i_l, i_r, j_l, j_r

match = Match()    

while True:
    line = sys.stdin.readline().strip()
    if line:
        value = line.split()
        if len(value) == 7:
            match.init(int(value[0]), int(value[1]), int(value[2]), int(value[3]), int(value[4]), int(value[5]), int(value[6]))
        else:
           match.input_params(int(value[0]), int(value[1]), int(value[2]), int(value[3]))
    else:
        break


resutl = match.result()
print(total)
"""

import sys
import math

i = 0
j = 0
w = 0
h = 0
s = 0
t = 0
P = 0
Q = 0
k = 0
result = 0
total = 0

#bitmap = {}
g_x_l = 0
g_x_r = 0
g_y_l = 0
g_y_r = 0
vector = []
H_count = 0
V_count = 0

def merge(intervals):
        if intervals == []:
            return []
        intervals.sort(key = lambda x:x[0])
        rel = [intervals[0]]
        for i in intervals[1:]:
            if rel[-1][1] >= i[0]:
                rel[-1][1] = max(rel[-1][1], i[1])
            else:
                rel.append(i)
        return rel



def count(X, Y, W, H):
    x_tl = X + 1 - w
    x_tr = X + W - 1 + w
    y_tl = Y + 1 - h
    y_bl = Y + H - 1 + h

    accum = 0
    
    if x_tl > 0:
        x_left_value = x_tl
    else:
        x_left_value = 0
    
    if x_tr > P:
        x_right_value = P
    else:
        x_right_value = x_tr
     
    i_l = int(math.ceil(x_left_value / s))
    i_r = (x_right_value - w) // s
    #i_count = i_r - i_l + 1
    
    if y_tl > 0:
        y_left_value = y_tl
    else:
        y_left_value = 0
    
    if y_bl > Q:
        y_right_value = Q
    else:
        y_right_value = y_bl
        
    j_l = int(math.ceil(y_left_value / t))
    j_r = (y_right_value - h) // t
    #j_count = j_r - j_l + 1

    return i_l, i_r, j_l, j_r
    

while True:
    line = sys.stdin.readline().strip()
    if line:
        value = line.split()
        if len(value) == 7:
            w = int(value[0])
            h = int(value[1])
            s = int(value[2])
            t = int(value[3])
            k = int(value[4])
            P = int(value[5])
            Q = int(value[6])

            g_x_l = P
            g_y_l = Q
            H_count = (P - w) // s + 1
            V_count = (Q - h) // t + 1
            rect_count = H_count * V_count
            #vector = [[H_count, 0]] * V_count
            #vector = [[H_count + 1, -1] for _ in range(V_count + 1)]
            vector = [[] for _ in range(V_count + 1)]
        else:
            #result = count(int(value[0]), int(value[1]), int(value[2]), int(value[3]))
            #total += result
            

            i_l, i_r, j_l, j_r =  count(int(value[0]), int(value[1]), int(value[2]), int(value[3]))

         
            for y_j in range(j_l, j_r + 1):
                if len(vector[y_j]) == 0:
                    vector[y_j].append([i_l, i_r])
                elif i_r < vector[y_j][0][0] or i_l > vector[y_j][0][1]:
                    vector[y_j].append([i_l, i_r])
                else:
                    if i_l <= vector[y_j][0][0]:
                        vector[y_j][0][0] = i_l
                    if i_r >= vector[y_j][0][1]:
                        vector[y_j][0][1] = i_r

                #for x_i in range(i_l, i_r + 1):
                #    for y_j in range(j_l, j_r + 1):
                 #       vector[y_j * H_count + x_i] = 1
            

    else:
        break


for n in vector:
    internals = merge(n)
    for n in internals:
        minus = n[1] - n[0] + 1
        total += minus


#total = i_count * j_count

print(total)